#ifndef	__TYPEDEFS__
#define	__TYPEDEFS__

#include "define.h"

#ifdef TASKINGC

#define DATA			_data
#define PDATA			_pdat
#define IDATA			idat
#define CODE			_rom
#define REENTRANT		_reentrant
#define	AT(atpos2)		_at( atpos2 )
#define CODE_P			_rom
#define PDATA_P			_pdat
#define IDATA_P			idat
#define DATA_P			_data

#define INTERRUPT( num, name )	_interrupt(num) void name (void)

#elif defined KEILC

#define DATA		data
#define PDATA		pdata
#define IDATA		idata
#define XDATA		xdata
#define CODE		code
#define CODE_P
#define PDATA_P
#define IDATA_P
#define DATA_P

#define INTERRUPT( num, name ) name() interrupt num

#endif
#if 0//By Tiger
#define	BIT0		(0x0001)
#define	BIT1		(0x0002)
#define	BIT2		(0x0004)
#define	BIT3		(0x0008)
#define	BIT4		(0x0010)
#define	BIT5		(0x0020)
#define	BIT6		(0x0040)
#define	BIT7		(0x0080)
#define	BIT8		(0x0100)
#define	BIT9		(0x0200)
#define	BIT10		(0x0400)
#define	BIT11		(0x0800)
#define	BIT12		(0x1000)
#define	BIT13		(0x2000)
#define	BIT14		(0x4000)
#define	BIT15		(0x8000)

#define U8  unsigned char
#define U16 unsigned int
#define S8  signed char
#define S16 signed int
#endif
//==================================================================================
#define	NULL		0
#define	ON			1
#define	OFF		0

//==================================================================================
#define	SetBit(x,y)			((x) |= (y))         
#define	ClearBit(x,y)		((x) &= ~(y))        
#define	BitSet(x,y)			(((x)&(y))== (y))    
#define	BitClear(x,y)		(((x)&(y))== 0)      
#define	IfBitSet(x,y)		if(((x)&(y)) == (y)) 
#define	IfBitClear(x,y)	if(((x)&(y)) == 0)


#define _between(x, a, b)	(a<=x && x<=b)
#define _swap(a, b)			{ a^=b; b^=a; a^=b; }

typedef	unsigned char	Register;
typedef	unsigned char	BYTE;
typedef	unsigned int	WORD;
typedef	unsigned long	DWORD;

#define	TRUE	1
#define	FALSE	0

//VInputStdDetectMode
#define AUTO	0
#if 0 //By Tiger
//VInputStd
#define NTSC	1			
#define PAL		2
#define SECAM	3
#define NTSC4	4
#define PALM	5
#define PALN	6
#define PAL60	7

#define MAXINPUTSTD	PAL60	// 

#define UNKNOWN	0xfe
#define NOINPUT	0	//0xff
#endif //By Tiger
 
typedef struct _BITMAP{
	unsigned short height;				//vertical size
	unsigned short width;				// horizontal size			
	unsigned char *bmpdata;				//bitmap data pointer
} BITMAP;


#define NIL			0xff


enum channel_type{CH_FULL,CH_TWO,CH_FOUR,CH_SIX,CH_EIGHT,CH_5PLUS1,CH_7PLUS1};


#endif	/* __TYPEDEFS__ */
